package com.example.guiguiapplicatio.fragment;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.navigation.Navigation;

import com.example.guiguiapplicatio.R;
import com.example.guiguiapplicatio.databinding.FragmentHomeBinding;
import com.google.android.material.bottomnavigation.BottomNavigationView;

public class HomeFragment extends Fragment {
    FragmentHomeBinding binding;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = FragmentHomeBinding.inflate(inflater, container, false);
        View view = binding.getRoot();
        return view;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {


        //对应所有按钮的跳转

        binding.signingImg.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_navigation_service));
        binding.poorImg.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_poorFragment));
        binding.breakContinueImg.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_breakContinueFragment));
        binding.buttonNewProfile.setOnClickListener(
                Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_newFileFragment)

        );
        binding.buttonNewSigning.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_newSigningFragment));
        binding.buttonNewFollowUp.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_newFollowUpFragment));
        binding.healthRecordImg.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_recordFragment));
        binding.doubleImg.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_examinationRecordFragment));
        binding.servciepackImg.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_navigation_home_to_servciePackFragment));

    }

    @Override
    public void onResume() {
        BottomNavigationView bottomNavigationView = requireActivity().findViewById(R.id.nav_view);
        bottomNavigationView.setVisibility(View.VISIBLE);
        super.onResume();
    }
}
